package com.nf.controller;

import com.nf.entity.Jdbc;
import com.nf.service.JdbcServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/list")
public class JdbcListServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        JdbcServiceImpl jdbcService=new JdbcServiceImpl();
        List<Jdbc> jdbcs=jdbcService.selectAll();
        req.setAttribute("jdbcs",jdbcs);
        req.getRequestDispatcher("list.jsp").forward(req,resp);
    }
}
